import React from 'react';
import ReactDOM from 'react-dom';

import { Router } from 'react-router';
import { browserHistory } from 'react-router';

// import { createHashHistory } from 'history';

// import routes from './routes';
import Test from './pages/test/Test';
import App from './pages/app/App';
import Club from './pages/club/Club';
import Athlete from './pages/athlete/Athlete';
import Schedule from './pages/schedule/Schedule';
import MainClub from './pages/mainClub/MainClub';
import MainAthlete from './pages/mainAthlete/MainAthlete';
import MainSchedule from './pages/mainSchedule/MainSchedule';
import MainVideo from './pages/mainVideo/MainVideo';
import MainRules from './pages/mainRules/MainRules';

import { Route, IndexRoute } from 'react-router';
import { useRouterHistory } from 'react-router';


require('./components/common/Common.js');
require('./styles/style.scss');
require('./fonts/iconfont.eot');
require('./fonts/iconfont.svg');
require('./fonts/iconfont.ttf');
require('./fonts/iconfont.woff');



// const appHistory = useRouterHistory(createHashHistory)({ queryKey: false });

            // <IndexRoute component={ MainClub } />
ReactDOM.render(
    <Router  history={browserHistory}>
        <Route path="/" component = { App }>
            <IndexRoute component = {MainClub} />
            <Route path="test" component={Test } />
            <Route path="clublist" component={ MainClub } />
            <Route path="athletelist" component={ MainAthlete } />
            <Route path="schedulelist" component={ MainSchedule } />
            <Route path="videolist" component={ MainVideo } />
            <Route path="rules" component={ MainRules } />

        </Route>
        <Route path="clublist/:club_id" component={ Club } />
        <Route path="athletelist/:athlete_id" component={Athlete} />
        <Route path="schedulelist/:schedule_id" component={Schedule} />
    </Router>,
    document.getElementById('app')
);
